/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.assets.shooterstates;

import edu.wpi.first.wpilibj.templates.RobotMap;
import edu.wpi.first.wpilibj.templates.assets.statemachine.State;
import edu.wpi.first.wpilibj.templates.commands.CommandBase;

/**
 *
 * @author Jarrod Risley
 */
public class OffState extends State {

    /*
     * Global Class Variables
     */
    protected static final OffState OFF = new OffState("OFF");
    
    // CONSTRUCTOR //
    
    
    protected OffState(String name) {
        super(name);
    } // end OffState Constructor
    
    
    protected void runFirst() {
    } // end runFirst

    protected void run() {
        
        System.out.println(this + " running.");
        
        CommandBase.intake.intake(RobotMap.STOP_INTAKE);
        CommandBase.shooter.stop();
        
        setFinished();
        
    } // end run

    protected void runLast() {
    } // end runLast

    protected boolean isFinished() {
        
        return getFinished();
        
    } // end isFinished

    protected void end() {
        
        System.out.println(this + " ended.");
        
    } // end end...lolz =P

    protected State getChainedInstance(State nextState) {
        
        OFF.setNext(nextState);
        return OFF;
        
    } // end getChainedInstance
    
} // end OffState
